<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1.声明函数
        /* function 函数名(){
            函数体
        } */
        function sayHi(){
            console.log('hi~');
        }
        //1.function 声明函数的关键字
        //2.调用函数
        // 函数名();

        sayHi();


        function getSum(){
            var sum=0;
            for(var i=1;i<=100;i++){
                sum+=i;
            }
            console.log(sum);
        }
        getSum();
        function Sum(a,b) {
            var sum;
            sum=a+b;
            console.log(sum);
        }
        console.log(Sum(1,2));
    </script>
</head>



<body>
    
</body>
</html>